﻿package com.victim.snake.user {
	
	import flash.utils.ByteArray;
	
	//用户消息
	public class Msg extends ByteArray{
		var type:int=0;	//消息类型
		
		override public function toString():String{
			this.position=0;
			var str:String="";
			str+=this.type+" ";
			for(var i:int=0;i<this.length;i++){
				str+=this.readByte()+" ";
			}
			return str;
		}
		
		//读取utrf消息内容
		public function getUTF8Content():String{
			this.position=0;
			return this.readMultiByte(this.length,"UTF-8");
		}
	}
	
}
